package com.bocweb.fly.jiaodao.fragment;


import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.bocweb.fly.jiaodao.R;
import com.bocweb.fly.jiaodao.utils.CircularImage;
import com.bumptech.glide.Glide;
import com.github.mzule.activityrouter.router.Routers;
import com.milk.base.BaseFragment;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by fly on 16/10/10.
 */
public class FmMy extends BaseFragment {
    @Bind(R.id.cover_user_photo)
    CircularImage circularImage;
    @Bind(R.id.title)
    TextView mTitle;
    @Bind(R.id.toolbar)
    Toolbar mToolbar;
    @Bind(R.id.lin_my_friend)
    LinearLayout linMyFriend;
    @Bind(R.id.lin_mine_detail)
    LinearLayout linMineDetail;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_my;
    }

    @Override
    protected boolean flux() {
        return false;
    }

    @Override
    public void initData() {
        mTitle.setText("我的");
        Glide.with(getActivity())
                .load(R.mipmap.ic_photo)
                .placeholder(R.mipmap.ic_photo)
                .into(circularImage);
    }

    @OnClick({R.id.lin_my_friend,R.id.lin_mine_detail,R.id.rel_fk})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.lin_my_friend:
                Routers.open(getActivity(), "jiaodao://myfriend");
                break;
            case R.id.lin_mine_detail://个人详情
                Routers.open(getActivity(), "jiaodao://mineDetails");
                break;
            case R.id.rel_fk://意见反馈
                Routers.open(getActivity(), "jiaodao://feedback");
                break;
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        ButterKnife.bind(this, rootView);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}

